<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>pageBar</title>
</head>
<body>
    <nav class="mt-5" th:if="${page.rows>0}" th:fragment="pageBar">
        <ul class="pagination justify-content-center">
            <li class="page-item">
                <a class="page-link" th:href="@{${page.path}(current=1)}">首页</a>
            </li>
            <li th:class="|page-item ${page.current==1?'disabled':''}|">
                <a class="page-link" th:href="@{${page.path}(current=${page.current - 1})}">上一页</a></li>
            <li th:class="|page-item ${i==page.current?'active':''}|"
                th:each="i:${#numbers.sequence(page.from,page.to)}">
                <a class="page-link" th:href="@{${page.path}(current=${i})}" th:text="${i}">1</a>
            </li>
            <li th:class="|page-item ${page.current==page.total?'disabled':''}|">
                <a class="page-link" th:href="@{${page.path}(current=${page.current+1})}">下一页</a>
            </li>
            <li class="page-item">
                <a class="page-link" th:href="@{${page.path}(current=${page.total})}">末页</a>
            </li>
        </ul>
    </nav>
</body>
</html>